package com.webcash.CNBoard.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.webcash.CNBoard.Model.MyProject;
import com.webcash.CNBoard.Model.Project;
import com.webcash.CNBoard.Model.WorkInfoInProject;
import com.webcash.CNBoard.Service.ProjectService;


@Controller
@RequestMapping("/project/summary")
@SessionAttributes("login")
public class ProjectSummaryController {
	
	@Autowired
	ProjectService projectService;
	@Autowired
	MyProject myProject;
	@RequestMapping
	public String action( Model model){
		
		Project project = projectService.getProjectByProjectNo(myProject.getProjectNo());
		WorkInfoInProject workInfo = projectService
				.getWorkListInfoByProjectNo(myProject.getProjectNo());
		
		model.addAttribute("project", project);
		model.addAttribute("workInfo", workInfo);
		return "project/projectSummary";
	}
}
